Introduce GtkMenuTracker
authorRyan Lortie <desrt@desrt.ca>
Fri, 22 Mar 2013 21:24:46 +0000 (17:24 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 1 Apr 2013 20:45:19 +0000 (16:45 -0400)
commit5617b584202b1f967f287dfd03a4560975f1389b
tree293e53b55dad608d229ee0e59b81498a1c8f100b
parente250e52175d5f62e99c7491d95923ad521e1421c
Introduce GtkMenuTracker

GtkMenuTracker folds a nested structure of sections in a GMenuModel into
a single linear menu, which it expresses to its user by means of 'insert
item at position' and 'remove item at position' callbacks.

The logic for where to insert separators and how to handle action
namespaces is contained within the tracker, removing the need to have
this logic duplicated in the 3 or 4 places that consume GMenuModel.

In comparison with the previous code, the tracker no longer completely
destroys and rebuilds menus every time a single change occurs.  As a
result, the new gtkmenu testcase now runs in approximately 3 seconds
instead of ~60 before.

https://bugzilla.gnome.org/show_bug.cgi?id=696468
gtk/Makefile.am
gtk/gtkmenushell.c
gtk/gtkmenushellprivate.h
gtk/gtkmenutracker.c [new file with mode: 0644]
gtk/gtkmenutracker.h [new file with mode: 0644]
gtk/gtkmodelmenu.c [deleted file]
gtk/gtkmodelmenuitem.c
gtk/gtkmodelmenuitem.h